<template>
  <div class='scroll-box card-box'
       v-if="visible">
    <el-dialog :visible.sync="visible"
               :close-on-click-modal="false"
               :append-to-body="true"
               :before-close="closeDialog"
               class="add-or-updata"
               width="70%"
               :close-on-press-escape="false">
      <div v-loading='dataListLoading'>
        <el-table ref="table"
                  :data="dataList"
                  border
                  tooltip-effect="dark"
                  style="width: 100%">
          <el-table-column type="index"
                           label="序号"
                           header-align="center"
                           align="center"
                           width="50">
          </el-table-column>
          <el-table-column prop="rechargeType"
                           label="充值类型"
                           show-overflow-tooltip
                           header-align="center"
                           align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.rechargeType === 0">叠加充值</span>
              <span v-if="scope.row.rechargeType === 1">重置充值</span>
            </template>
          </el-table-column>
          <el-table-column prop="jobNumber"
                           label="工号"
                           show-overflow-tooltip
                           header-align="center"
                           align="center">
          </el-table-column>
          <el-table-column prop="theirName"
                           label="姓名"
                           show-overflow-tooltip
                           header-align="center"
                           align="center">
          </el-table-column>
          <el-table-column prop="moneySum"
                           label="充值金额"
                           show-overflow-tooltip
                           header-align="center"
                           align="center">
          </el-table-column>
          <el-table-column prop="createDate"
                           label="充值时间"
                           show-overflow-tooltip
                           header-align="center"
                           align="center">
          </el-table-column>
        </el-table>
      </div>
      <template slot="footer">
        <el-button @click="closeDialog">{{ $t("cancel") }}</el-button>
      </template>
    </el-dialog>
  </div>
</template>
<script>

import mixinViewModule from '@/mixins/view-module'
import minFormValidate from '@/mixins/form-validate'
export default {
  mixins: [mixinViewModule, minFormValidate],
  name: '',
  data () {
    return {
      mixinViewModuleOptions: {
        getDataInfoURL: '/tb/companyRecharge/queryRecord?rechargeId='
      },
      visible: false,
      dataList: [],
      dataForm: {}
    }
  },
  components: {},
  computed: {},
  mounted () {},
  methods: {
    closeDialog () {
      this.visible = false
      this.dataList = []
    },
    init (data) {
      this.visible = true
      data = data || []
      this.dataForm.id = data
      this.getDataInfo().then(res => {
        this.dataList = res.data
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.pagination {
  text-align: right;
  margin-top: 5px;
}
</style>
